package net.jeeshop.services.front.bbs.dao.impl;

import net.jeeshop.core.dao.BaseDao;
import net.jeeshop.core.dao.page.PagerModel;
import net.jeeshop.services.front.bbs.bean.BbsComment;
import net.jeeshop.services.front.bbs.dao.BbsCommentDao;
import net.jeeshop.services.front.bbs.dto.BbsCommentDTO;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * Created by zuohao on 16/7/7.
 */
@Repository("bbsCommentDaoFront")
public class BbsCommentDaoImpl implements BbsCommentDao {

    @Resource
    private BaseDao dao;

    @Override
    public int insert(BbsComment bbsComment) {
        return 0;
    }

    @Override
    public int delete(BbsComment bbsComment) {
        return 0;
    }

    @Override
    public int update(BbsComment bbsComment) {
        return 0;
    }

    @Override
    public BbsComment selectOne(BbsComment bbsComment) {
        return null;
    }

    @Override
    public PagerModel selectPageList(BbsComment bbsComment) {
        return null;
    }

    @Override
    public List<BbsComment> selectList(BbsComment bbsComment) {
        return null;
    }

    @Override
    public int deleteById(int id) {
        return 0;
    }

    @Override
    public BbsComment selectById(String id) {
        return null;
    }

    @Override
    public List<BbsComment> selectBbsCommentByBbsDetailId(Map map) {
        return dao.selectList("front.bbsComment.selectBbsCommentByBbsDetailId", map);
    }

    @Override
    public int selectBbsCommentCountByBbsDetailId(Map map) {
        return dao.getCount("front.bbsComment.selectBbsCommentCountByBbsDetailId", map);
    }

    @Override
    public void insertBbsComment(BbsComment bbsComment) {
        dao.insert("front.bbsComment.insertBbsComment", bbsComment);
    }

    @Override
    public List<BbsComment> selectBbsCommentByType(Map<String, Object> map) {
        return dao.selectList("front.bbsComment.selectBbsCommentByType", map);
    }

    @Override
    public int deleteBbsCommentById(Map map) {
//        return dao.delete("front.bbsComment.deleteBbsCommentById",commentId);
        return dao.update("front.bbsComment.updateStatusById", map);
    }

    @Override
    public int deleteBbsCommentByDetailId(String detailId) {
        return dao.update("front.bbsComment.updateStatusByDetailId", detailId);
    }

    @Override
    public List<BbsCommentDTO> selectBbsCommentDTOByBbsDetailId(Map<String, Object> param) {
        return dao.selectList("front.bbsComment.selectBbsCommentByBbsDetailId", param);

    }
}
